#pragma once

#include <gofcl_timer_r.h>

typedef struct {
	u16_s SMC : 3;
	u16_s : 1;
	u16_s TRGS : 3;
	u16_s MSM : 1;
	u16_s ETFC : 4;
	u16_s ETPSC : 2;
	u16_s SMC1 : 1;
	u16_s ETP : 1;
} timer_smcfg_s;

_Static_assert(sizeof(timer_smcfg_s) == 2,
	       "Struct timer_smcfg_s defined error!");

static void timer_wreg_smcfg_s(timer_qe timer_q, timer_smcfg_s smcfg) {
	union {
		timer_smcfg_s s;
		u16_s u;
	} su = {
		.s = smcfg,
	};
	timer_wreg_u16(timer_q, TIMER_SMCFG_R, T16B_0_R, su.u);
}
